package com.tm;

import com.tm.Main;

/**
 * 2024/5/2
 */
public class Demo25 {
    public static void main(String[] args) {
        //目标：掌握数组元素求最大值
        int [] arr={15,9000,10000,20000,9500,-5};
        int max=0;
        for (int i = 0; i <arr.length; i++) {
            if(arr[i]>max){
                max=arr[i];
            }
        }
        System.out.println(max);

        int min=0;
        for (int i = 0; i <arr.length; i++) {
            if(arr[i]<min){
                min=arr[i];
            }
        }
        System.out.println(min);
    }



}
